﻿using System;
using System.Linq;
using Microsoft.Samples.ServiceHosting.StorageClient;

namespace CCS
{
    public class PaymentCustInfo : TableStorageEntity
    {
        public const string TableName = "PaymentCustInfos";

        public PaymentCustInfo(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public PaymentCustInfo()
        {
        }

        public Guid ID { get; set; }

        public String Address1 { get; set; }

        public String Address2 { get; set; }

        public String AddressName { get; set; }

        public String AddressStatus { get; set; }

        public String BusinessName { get; set; }

        public String City { get; set; }

        public String Country { get; set; }

        public String DayPhoneA { get; set; }

        public String DayPhoneB { get; set; }

        public String DayPhoneC { get; set; }

        public String Email { get; set; }

        public String FirstName { get; set; }

        public String LastName { get; set; }

        public String NightPhoneA { get; set; }

        public String NightPhoneB { get; set; }

        public String NightPhoneC { get; set; }

        public String PayerID { get; set; }

        public String PayerStatus { get; set; }

        public String State { get; set; }

        public String Zip { get; set; }
    }

    public class PaymentCustInfoServiceContext : TableStorageDataServiceContext
    {
        public PaymentCustInfoServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<PaymentCustInfo> PaymentCustInfos
        {
            get { return CreateQuery<PaymentCustInfo>("PaymentCustInfos"); }
        }
    }

    public class PaymentShoppingItems : TableStorageEntity
    {
        public const string TableName = "PaymentShoppingItems";

        public PaymentShoppingItems(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public PaymentShoppingItems()
        {
        }

        public Guid ID { get; set; }

        public String ItemName { get; set; }

        public String ItemNumber { get; set; }

        public String Option1FieldName { get; set; }

        public String Option1Values { get; set; }

        public String Option2FieldName { get; set; }

        public String Option2Values { get; set; }
    }

    public class PaymentShoppingItemsServiceContext : TableStorageDataServiceContext
    {
        public PaymentShoppingItemsServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<PaymentShoppingItems> PaymentShoppingItems
        {
            get { return CreateQuery<PaymentShoppingItems>("PaymentShoppingItems"); }
        }
    }

    public class PaymentTransaction : TableStorageEntity
    {
        public const string TableName = "PaymentTransactions";

        public PaymentTransaction(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public PaymentTransaction()
        {
        }

        public Guid ID { get; set; }

        public DateTime ReceivedDateTime { get; set; }

        public String Business { get; set; }

        public Guid DeveloperToken { get; set; }

        public String Invoice { get; set; }

        public String McCurrency { get; set; }

        public Double McFee { get; set; }

        public Double McGross { get; set; }

        public String Memo { get; set; }

        public DateTime PaymentDate { get; set; }

        public String PaymentStatus { get; set; }

        public String PaymentType { get; set; }

        public String PendingReason { get; set; }

        public String ReceiverEmail { get; set; }

        public String ReceiverID { get; set; }

        public Int32 RecurTimes { get; set; }

        public Double SettleAmount { get; set; }

        public String SettleCurrency { get; set; }

        public Double Tax { get; set; }

        public String TransactionID { get; set; }

        public String TransactionType { get; set; }
    }

    public class PaymentTransactionServiceContext : TableStorageDataServiceContext
    {
        public PaymentTransactionServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<PaymentTransaction> PaymentTransactions
        {
            get { return CreateQuery<PaymentTransaction>("PaymentTransactions"); }
        }
    }

    public class PaymentTransactionRelated : TableStorageEntity
    {
        public const string TableName = "PaymentTransactionRelateds";

        public PaymentTransactionRelated(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public PaymentTransactionRelated()
        {
        }

        public Guid ID { get; set; }

        public Double ExchangeRate { get; set; }

        public String IPNVersion { get; set; }

        public String IsRecurring { get; set; }

        public String Option1FieldName { get; set; }

        public String Option1Selection { get; set; }

        public String Option2FieldName { get; set; }

        public String Option2Selection { get; set; }

        public String Password { get; set; }

        public String RawIPN { get; set; }

        public String ReasonCode { get; set; }

        public String ReattemptFailedPayments { get; set; }

        public DateTime ReattemptFailedPaymentsDate { get; set; }

        public String Username { get; set; }

        public String VerifySign { get; set; }
    }

    public class PaymentTransactionRelatedServiceContext : TableStorageDataServiceContext
    {
        public PaymentTransactionRelatedServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<PaymentTransactionRelated> PaymentTransactionRelateds
        {
            get { return CreateQuery<PaymentTransactionRelated>("PaymentTransactionRelateds"); }
        }
    }

    public class CCSCoupon : TableStorageEntity
    {
        public const string TableName = "CCSCoupons";

        public CCSCoupon(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSCoupon()
        {
        }

        public Int32 ID { get; set; }

        public DateTime Created_date { get; set; }

        public Guid Coupon_number { get; set; }

        public DateTime Used_date { get; set; }

        public Guid License_level { get; set; }

        public Guid DevToken { get; set; }
    }

    public class CCSCouponServiceContext : TableStorageDataServiceContext
    {
        public CCSCouponServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSCoupon> CCSCoupons
        {
            get { return CreateQuery<CCSCoupon>("CCSCoupons"); }
        }
    }

    public class CCSDevToken : TableStorageEntity
    {
        public const string TableName = "CCSDevTokens";

        public CCSDevToken(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSDevToken()
        {
        }

        public Int32 UserID { get; set; }

        public Guid DeveloperToken { get; set; }

        public Guid UserName { get; set; }
    }

    public class CCSDevTokenServiceContext : TableStorageDataServiceContext
    {
        public CCSDevTokenServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSDevToken> CCSDevTokens
        {
            get { return CreateQuery<CCSDevToken>("CCSDevTokens"); }
        }
    }

    public class CCSException : TableStorageEntity
    {
        public const string TableName = "CCSExceptions";

        public CCSException(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSException()
        {
        }

        public Guid ExceptionID { get; set; }

        public DateTime ExceptionDateTime { get; set; }

        public String Message { get; set; }

        public String Source { get; set; }

        public String StackTrace { get; set; }

        public String MethodName { get; set; }

        public Guid ProductID { get; set; }

        public Guid DevToken { get; set; }

        public Guid LicenseLevelID { get; set; }

        public String UniqueMachineID { get; set; }
    }

    public class CCSExceptionServiceContext : TableStorageDataServiceContext
    {
        public CCSExceptionServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSException> CCSExceptions
        {
            get { return CreateQuery<CCSException>("CCSExceptions"); }
        }
    }

    public class CCSIssue : TableStorageEntity
    {
        public const string TableName = "CCSIssues";

        public CCSIssue(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSIssue()
        {
        }

        public Guid IssueID { get; set; }

        public DateTime IssueDate { get; set; }

        public Guid IssueProductID { get; set; }

        public Guid IssueLicenseLevelID { get; set; }

        public String IssueEmailContact { get; set; }

        public String IssueFirstName { get; set; }

        public String IssueLastName { get; set; }

        public String IssueDescription { get; set; }

        public Guid IssueDevToken { get; set; }

        public String IssueUniqueMachineID { get; set; }
    }

    public class CCSIssueServiceContext : TableStorageDataServiceContext
    {
        public CCSIssueServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSIssue> CCSIssues
        {
            get { return CreateQuery<CCSIssue>("CCSIssues"); }
        }
    }

    public class CCSLicenseLevelPrice : TableStorageEntity
    {
        public const string TableName = "CCSLicenseLevelPrices";

        public CCSLicenseLevelPrice(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSLicenseLevelPrice()
        {
        }

        public Guid LicenseID { get; set; }

        public Guid ProductID { get; set; }

        public String LicenseLevel { get; set; }

        public Double LicenseLevelPrice { get; set; }

        public Guid DevToken { get; set; }

        public Boolean TrialLicenseKey { get; set; }

        public Int32 ClientID { get; set; }

        public String Description { get; set; }
    }

    public class CCSLicenseLevelPriceServiceContext : TableStorageDataServiceContext
    {
        public CCSLicenseLevelPriceServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSLicenseLevelPrice> CCSLicenseLevelPrices
        {
            get { return CreateQuery<CCSLicenseLevelPrice>("CCSLicenseLevelPrices"); }
        }
    }

    public class CCSLicenseTransaction : TableStorageEntity
    {
        public const string TableName = "CCSLicenseTransactions";

        public CCSLicenseTransaction(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSLicenseTransaction()
        {
        }

        public Guid ID { get; set; }

        public DateTime TransDate { get; set; }

        public String Invoice { get; set; }

        public String ClientID { get; set; }

        public Guid ProductID { get; set; }

        public Guid ProductLicenseLevelID { get; set; }

        public String AuthLicense { get; set; }

        public String LicenseResponse { get; set; }

        public Guid DevToken { get; set; }

        public String SerialClientID { get; set; }
    }

    public class CCSLicenseTransactionServiceContext : TableStorageDataServiceContext
    {
        public CCSLicenseTransactionServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSLicenseTransaction> CCSLicenseTransactions
        {
            get { return CreateQuery<CCSLicenseTransaction>("CCSLicenseTransactions"); }
        }
    }

    [Serializable]
    public class CCSPaymentSettings : TableStorageEntity
    {
        public const string TableName = "CCSPaymentSettings";

        public CCSPaymentSettings(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSPaymentSettings()
        {
        }

        public Guid DevToken { get; set; }

        public String PayPal_AccountEmail { get; set; }

        public String PayPal_ItemNumber { get; set; }

        public Int32 PayPal_Quantity { get; set; }

        public String PayPal_currencyCode { get; set; }

        public String PayPal_notifyURL { get; set; }

        public Boolean PayPal_requireShippingAddress { get; set; }

        public Boolean PayPal_includeNote { get; set; }

        public String PayPal_logoURL { get; set; }

        public String PayPal_tag { get; set; }

        public String PayPal_noteTitle { get; set; }

        public String PayPal_successUrl { get; set; }

        public String PayPal_cancelURL { get; set; }

        public String Payment_URL { get; set; }
    }

    public class CCSPaymentSettingsServiceContext : TableStorageDataServiceContext
    {
        public CCSPaymentSettingsServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSPaymentSettings> CCSPaymentSettings
        {
            get { return CreateQuery<CCSPaymentSettings>("CCSPaymentSettings"); }
        }
    }

    public class CCSProduct : TableStorageEntity
    {
        public const string TableName = "CCSProducts";

        public CCSProduct(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSProduct()
        {
        }

        public Guid ID { get; set; }

        public String ProductName { get; set; }

        public DateTime ProductReleaseDate { get; set; }

        public String ProductVersion { get; set; }

        public Int32 LicensesPerInvoice { get; set; }

        public Guid DevToken { get; set; }
    }

    public class CCSProductServiceContext : TableStorageDataServiceContext
    {
        public CCSProductServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSProduct> CCSProducts
        {
            get { return CreateQuery<CCSProduct>("CCSProducts"); }
        }
    }

    public class CCSProductConfigSettings : TableStorageEntity
    {
        public const string TableName = "CCSProductConfigSettings";

        public CCSProductConfigSettings(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSProductConfigSettings()
        {
        }

        public Guid ProductID { get; set; }

        public Int32 BuyNowMaxNumPoll { get; set; }

        public Int32 ActivateNowMaxNumPoll { get; set; }

        public Int32 TrialLengthDays { get; set; }

        public Int32 AbortTimerLength { get; set; }

        public Int32 PollingTimerLength { get; set; }

        public Guid DevToken { get; set; }
    }

    public class CCSProductConfigSettingsServiceContext : TableStorageDataServiceContext
    {
        public CCSProductConfigSettingsServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSProductConfigSettings> CCSProductConfigSettings
        {
            get { return CreateQuery<CCSProductConfigSettings>("CCSProductConfigSettings"); }
        }
    }

    public class CCSProductDataStore : TableStorageEntity
    {
        public const string TableName = "CCSProductDataStores";

        public CCSProductDataStore(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSProductDataStore()
        {
        }

        public Guid DataStoreID { get; set; }

        public Guid DevToken { get; set; }

        public DateTime DateTime { get; set; }

        public Guid ProductID { get; set; }

        public Guid LicenseID { get; set; }

        public Int32 NumberOfTrialDaysElapsed { get; set; }

        public String RegistrationKey { get; set; }

        public DateTime StartDate { get; set; }

        public Boolean UserInfoRegistered { get; set; }

        public String UniqueMachineID { get; set; }
    }

    public class CCSProductDataStoreServiceContext : TableStorageDataServiceContext
    {
        public CCSProductDataStoreServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSProductDataStore> CCSProductDataStores
        {
            get { return CreateQuery<CCSProductDataStore>("CCSProductDataStores"); }
        }
    }

    public class CCSUser : TableStorageEntity
    {
        public const string TableName = "CCSUsers";

        public CCSUser(string partitionKey, string rowKey) :
            base(partitionKey, rowKey)
        {
            this.InitTableStorageDefaults();
        }

        public CCSUser()
        {
        }

        public Guid UserID { get; set; }

        public DateTime UserDate { get; set; }

        public String UserLastName { get; set; }

        public String UserFirstName { get; set; }

        public String UserStreet { get; set; }

        public String UserCity { get; set; }

        public String UserState { get; set; }

        public String UserZip { get; set; }

        public String UserPhone { get; set; }

        public String UserEmail { get; set; }

        public Guid UserDevToken { get; set; }

        public Guid ProductID { get; set; }

        public Guid LicenseLevelID { get; set; }

        public String UniqueMachineID { get; set; }
    }

    public class CCSUserServiceContext : TableStorageDataServiceContext
    {
        public CCSUserServiceContext(StorageAccountInfo accountInfo) :
            base(accountInfo)
        {
        }

        public IQueryable<CCSUser> CCSUsers
        {
            get { return CreateQuery<CCSUser>("CCSUsers"); }
        }
    }
}